package com.xc.controller;

import com.xc.pojo.SysUser;
import com.xc.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private SysUserService sysUserService;

    @PostMapping("/login")
    public Object doLogin(@RequestBody SysUser sysUser){
        return sysUserService.login(sysUser);
    }

    @RequestMapping("/user/logout")
    public Object doLogout(){
        return sysUserService.logout();
    }
}
